using System;
using System.Data;
using System.Collections.Generic;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml;
using System.Xml.XPath;

namespace de_kleintjesmarkt
{
   public class FileReader
   {
      public Dictionary<int, string> ReadKranten()
      {
         //XmlTextReader reader = new XmlTextReader("Kranten.xml");
         Dictionary<int, string> krantenLijst = new Dictionary<int, string>();
         string lol = "", bla = "";
         XPathDocument Doc = new XPathDocument("Kranten.xml");
         XPathNavigator navigator = Doc.CreateNavigator();
         XPathNodeIterator iterator = navigator.Select("/kranten/krant");
         while (iterator.MoveNext())
         {
            if (iterator.Current.Name == "krant")
            {
               iterator.Current.MoveToFirstChild();
               lol = iterator.Current.Value;
               iterator.Current.MoveToNext();
               bla = iterator.Current.Value;
               krantenLijst.Add(Int32.Parse(bla), lol);
            }
         }
         return krantenLijst;
      }
   }
}
